﻿using SW.Lite.Infrastructure.Common;
using SW.Lite.Model;

namespace SW.Lite.IDAL
{
    public interface IField
    {
        /// <summary>
        ///     数据是否存在
        /// </summary>
        /// <param name="id">ID</param>
        bool Exists(int id);

        /// <summary>
        ///     获取单个项
        /// </summary>
        /// <param name="id">ID</param>
        FieldModel Single(int id);

        /// <summary>
        ///     获取所有项目
        /// </summary>
        PageList<FieldModel> All();

        /// <summary>
        ///     获取所有项目(分页)
        /// </summary>
        PageList<FieldModel> All(int pageIndex, int pageSize);

        /// <summary>
        ///     插入数据
        /// </summary>
        ExecuteResult Insert(FieldModel item);

        /// <summary>
        ///     更新数据
        /// </summary>
        ExecuteResult Update(FieldModel item);

        /// <summary>
        ///     删除数据
        /// </summary>
        /// <param name="id">ID</param>
        ExecuteResult Delete(int id);
    }
}